using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._TileCache
{
    /// <summary>
    /// <para>Export Tile Cache</para>
    /// <para>Exports tiles from an existing tile cache to a new tile cache or a tile package. The tiles can be either independently imported into other caches or accessed from ArcGIS Pro or mobile devices.</para>
    /// <para>将切片从现有切片缓存导出到新的切片缓存或切片包。切片可以独立导入到其他缓存中，也可以从 ArcGIS Pro 或移动设备访问。</para>
    /// </summary>    
    [DisplayName("Export Tile Cache")]
    public class ExportTileCache : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExportTileCache()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_cache_source">
        /// <para>Input Tile Cache</para>
        /// <para>An existing tile cache to be exported.</para>
        /// <para>要导出的现有切片缓存。</para>
        /// </param>
        /// <param name="_in_target_cache_folder">
        /// <para>Output Tile Cache Location</para>
        /// <para>The output folder into which the tile cache or tile package will be exported.</para>
        /// <para>将切片缓存或切片包导出到的输出文件夹。</para>
        /// </param>
        /// <param name="_in_target_cache_name">
        /// <para>Output Tile Cache Name</para>
        /// <para>The name of the exported tile cache or tile package.</para>
        /// <para>导出的切片缓存或切片包的名称。</para>
        /// </param>
        public ExportTileCache(object _in_cache_source, object _in_target_cache_folder, object _in_target_cache_name)
        {
            this._in_cache_source = _in_cache_source;
            this._in_target_cache_folder = _in_target_cache_folder;
            this._in_target_cache_name = _in_target_cache_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Export Tile Cache";

        public override string CallName => "management.ExportTileCache";

        public override List<string> AcceptEnvironments => ["parallelProcessingFactor"];

        public override object[] ParameterInfo => [_in_cache_source, _in_target_cache_folder, _in_target_cache_name, _export_cache_type.GetGPValue(), _storage_format_type.GetGPValue(), _scales, _area_of_interest, _out_cache];

        /// <summary>
        /// <para>Input Tile Cache</para>
        /// <para>An existing tile cache to be exported.</para>
        /// <para>要导出的现有切片缓存。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Tile Cache")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cache_source { get; set; }


        /// <summary>
        /// <para>Output Tile Cache Location</para>
        /// <para>The output folder into which the tile cache or tile package will be exported.</para>
        /// <para>将切片缓存或切片包导出到的输出文件夹。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Tile Cache Location")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_target_cache_folder { get; set; }


        /// <summary>
        /// <para>Output Tile Cache Name</para>
        /// <para>The name of the exported tile cache or tile package.</para>
        /// <para>导出的切片缓存或切片包的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Tile Cache Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_target_cache_name { get; set; }


        /// <summary>
        /// <para>Export Cache As</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the cache will be exported as a tile cache or a tile package. Tile packages are suitable for ArcGIS Runtime and ArcGIS Mobile deployments.</para>
        ///   <bulletList>
        ///     <bullet_item>Tile cache—The cache will be exported as a stand-alone cache raster dataset. This is the default.</bullet_item><para/>
        ///     <bullet_item>Tile package (tpk)—The cache will be exported as a single compressed file (.tpk) in which the cache dataset is added as a layer and consolidated so that it can be shared easily. This type can be used in ArcMap as well as in ArcGIS Runtime and ArcGIS Mobile applications.</bullet_item><para/>
        ///     <bullet_item>Tile package (tpkx)—The cache will be exported using Compact_v2 storage format (.tpkx), which provides better performance on network shares and cloud storage directories. This improved and simplified package structure type is supported by newer versions of the ArcGIS platform such as ArcGIS Online, ArcGIS Pro 2.3, ArcGIS Enterprise 10.7, and ArcGIS Runtime 100.5.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是将缓存导出为切片缓存还是切片包。切片包适用于 ArcGIS Runtime 和 ArcGIS Mobile 部署。</para>
        ///   <bulletList>
        ///     <bullet_item>切片缓存—缓存将导出为独立缓存栅格数据集。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>切片包 （tpk）—缓存将导出为单个压缩文件 （.tpk），其中缓存数据集将添加为图层并合并，以便轻松共享。此类型可用于 ArcMap 以及 ArcGIS Runtime 和 ArcGIS Mobile 应用程序。</bullet_item><para/>
        ///     <bullet_item>切片包 （tpkx） - 将使用Compact_v2存储格式 （.tpkx） 导出缓存，从而在网络共享和云存储目录上提供更好的性能。较新版本的 ArcGIS 平台（例如 ArcGIS Online、ArcGIS Pro 2.3、ArcGIS Enterprise 10.7 和 ArcGIS Runtime 100.5）支持这种改进和简化的包结构类型。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Export Cache As")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _export_cache_type_value _export_cache_type { get; set; } = _export_cache_type_value._TILE_CACHE;

        public enum _export_cache_type_value
        {
            /// <summary>
            /// <para>Tile cache</para>
            /// <para>Tile cache—The cache will be exported as a stand-alone cache raster dataset. This is the default.</para>
            /// <para>切片缓存—缓存将导出为独立缓存栅格数据集。这是默认设置。</para>
            /// </summary>
            [Description("Tile cache")]
            [GPEnumValue("TILE_CACHE")]
            _TILE_CACHE,

            /// <summary>
            /// <para>Tile package (tpk)</para>
            /// <para>Tile package (tpk)—The cache will be exported as a single compressed file (.tpk) in which the cache dataset is added as a layer and consolidated so that it can be shared easily. This type can be used in ArcMap as well as in ArcGIS Runtime and ArcGIS Mobile applications.</para>
            /// <para>切片包 （tpk）—缓存将导出为单个压缩文件 （.tpk），其中缓存数据集将添加为图层并合并，以便轻松共享。此类型可用于 ArcMap 以及 ArcGIS Runtime 和 ArcGIS Mobile 应用程序。</para>
            /// </summary>
            [Description("Tile package (tpk)")]
            [GPEnumValue("TILE_PACKAGE")]
            _TILE_PACKAGE,

            /// <summary>
            /// <para>Tile package (tpkx)</para>
            /// <para>Tile package (tpkx)—The cache will be exported using Compact_v2 storage format (.tpkx), which provides better performance on network shares and cloud storage directories. This improved and simplified package structure type is supported by newer versions of the ArcGIS platform such as ArcGIS Online, ArcGIS Pro 2.3, ArcGIS Enterprise 10.7, and ArcGIS Runtime 100.5.</para>
            /// <para>切片包 （tpkx） - 将使用Compact_v2存储格式 （.tpkx） 导出缓存，从而在网络共享和云存储目录上提供更好的性能。较新版本的 ArcGIS 平台（例如 ArcGIS Online、ArcGIS Pro 2.3、ArcGIS Enterprise 10.7 和 ArcGIS Runtime 100.5）支持这种改进和简化的包结构类型。</para>
            /// </summary>
            [Description("Tile package (tpkx)")]
            [GPEnumValue("TILE_PACKAGE_TPKX")]
            _TILE_PACKAGE_TPKX,

        }

        /// <summary>
        /// <para>Storage Format</para>
        /// <para><xdoc>
        ///   <para>Determines the storage format of tiles.</para>
        ///   <bulletList>
        ///     <bullet_item>Compact—Group tiles into large files called bundles. This storage format is more efficient in terms of storage and mobility.</bullet_item><para/>
        ///     <bullet_item>Compact v2— Tiles are grouped in bundle files only. This format provides better performance on network shares and cloudstore directories. If the Export cache type parameter is set to Tile package (tpkx) then the extension of the tile package is (.tpkx), which is supported by newer versions of the ArcGIS Platform such as ArcGIS Online, ArcGIS Enterprise 10.9 and ArcGIS Runtime 100.5.This is the default.</bullet_item><para/>
        ///     <bullet_item>Exploded—Each tile is stored as an individual file. Note that this format cannot be used with tile packages.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定切片的存储格式。</para>
        ///   <bulletList>
        ///     <bullet_item>紧凑 - 将切片分组到称为包的大文件中。这种存储格式在存储和移动性方面效率更高。</bullet_item><para/>
        ///     <bullet_item>Compact v2— 切片仅分组到包文件中。此格式在网络共享和云存储目录上提供更好的性能。如果导出缓存类型参数设置为切片包 （tpkx），则切片包的扩展名为 （.tpkx），这是较新版本的 ArcGIS 平台（如 ArcGIS Online、ArcGIS Enterprise 10.9 和 ArcGIS Runtime 100.5）支持的扩展名。</bullet_item><para/>
        ///     <bullet_item>分解 - 每个切片都存储为一个单独的文件。请注意，此格式不能用于切片包。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Storage Format")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _storage_format_type_value _storage_format_type { get; set; } = _storage_format_type_value._COMPACT_V2;

        public enum _storage_format_type_value
        {
            /// <summary>
            /// <para>Compact</para>
            /// <para>Compact—Group tiles into large files called bundles. This storage format is more efficient in terms of storage and mobility.</para>
            /// <para>紧凑 - 将切片分组到称为包的大文件中。这种存储格式在存储和移动性方面效率更高。</para>
            /// </summary>
            [Description("Compact")]
            [GPEnumValue("COMPACT")]
            _COMPACT,

            /// <summary>
            /// <para>Exploded</para>
            /// <para>Exploded—Each tile is stored as an individual file. Note that this format cannot be used with tile packages.</para>
            /// <para>分解 - 每个切片都存储为一个单独的文件。请注意，此格式不能用于切片包。</para>
            /// </summary>
            [Description("Exploded")]
            [GPEnumValue("EXPLODED")]
            _EXPLODED,

            /// <summary>
            /// <para>Compact v2</para>
            /// <para>Compact v2— Tiles are grouped in bundle files only. This format provides better performance on network shares and cloudstore directories. If the Export cache type parameter is set to Tile package (tpkx) then the extension of the tile package is (.tpkx), which is supported by newer versions of the ArcGIS Platform such as ArcGIS Online, ArcGIS Enterprise 10.9 and ArcGIS Runtime 100.5.This is the default.</para>
            /// <para>Compact v2— 切片仅分组到包文件中。此格式在网络共享和云存储目录上提供更好的性能。如果导出缓存类型参数设置为切片包 （tpkx），则切片包的扩展名为 （.tpkx），这是较新版本的 ArcGIS 平台（如 ArcGIS Online、ArcGIS Enterprise 10.9 和 ArcGIS Runtime 100.5）支持的扩展名。</para>
            /// </summary>
            [Description("Compact v2")]
            [GPEnumValue("COMPACT_V2")]
            _COMPACT_V2,

        }

        /// <summary>
        /// <para>Scales [Pixel Size] (Estimated Disk Space)</para>
        /// <para>A list of scale levels at which tiles will be exported.</para>
        /// <para>将导出切片的比例级别列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Scales [Pixel Size] (Estimated Disk Space)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _scales { get; set; } = null;


        /// <summary>
        /// <para>Area of Interest</para>
        /// <para><xdoc>
        ///   <para>An area of interest that spatially constrains where tiles will be exported from the cache.</para>
        ///   <para>The area of interest can be a feature class or a feature that you draw on the map.</para>
        ///   <para>This parameter is useful if you want to export irregularly shaped areas, as the tool clips the cache dataset at pixel resolution.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在空间上限制切片从缓存中导出的位置的感兴趣区域。</para>
        ///   <para>感兴趣区域可以是要素类，也可以是在地图上绘制的要素。</para>
        ///   <para>如果要导出形状不规则的区域，则此参数非常有用，因为该工具会以像素分辨率裁剪缓存数据集。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Area of Interest")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _area_of_interest { get; set; } = null;


        /// <summary>
        /// <para>Output Tile Cache</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Tile Cache")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_cache { get; set; }


        public ExportTileCache SetEnv(object parallelProcessingFactor = null)
        {
            base.SetEnv(parallelProcessingFactor: parallelProcessingFactor);
            return this;
        }

    }

}